﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace Delay
{
    public class ShrewdEyeView : DependencyObject, INotifyPropertyChanged
    {

        public ShrewdEyeView()
        {
            _shrewdEyeItems = new ObservableCollection<ShrewdEyeItem>();
        }

        public string GetPhoneInfoUrl()
        {
            //这个函数不同的类一般要改写
            string url;
            url = QueryXml.PhoneShrewdEyeUrl;
            url += ("imei=" + QueryXml.imei);
            url += ("&phonename=" + QueryXml.phonename);
            url += ("&phonevs=" + QueryXml.phonevs);
            url += ("&phonevsno=" + QueryXml.phonevsno);
            url += ("&keyvalue=" + QueryXml.keyvalue);
            url += ("&channelkey=" + QueryXml.channelkey);
            url += ("&downclassid=&downinfoid=&channelkey=&softvs=&network=");
            return url;
        }
        private int _isLoadSuccess;
        public int IsLoadSuccess
        {
            get
            {
                return _isLoadSuccess;
            }
            set
            {
                if (_isLoadSuccess != value)
                {
                    _isLoadSuccess = value;
                    NotifyPropertyChanged("IsLoadSuccess");
                }
            }
        }
        private ObservableCollection<ShrewdEyeItem> _shrewdEyeItems;
        public ObservableCollection<ShrewdEyeItem> ShrewdEyeItemS
        {
            get
            {
                return _shrewdEyeItems;
            }
            set
            {
                if (_shrewdEyeItems != value)
                {
                    _shrewdEyeItems = value;
                    NotifyPropertyChanged("ShrewdEyeItemS");
                }
            }
        }
       
        public event PropertyChangedEventHandler PropertyChanged;
        private void NotifyPropertyChanged(String propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (null != handler)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
}
